import request from '@/utils/request'

// 查询VIP订单列表
export function listVipOrder(query) {
  return request({
    url: '/vip/order/list',
    method: 'get',
    params: query
  })
}

// 查询VIP订单详细
export function getVipOrder(id) {
  return request({
    url: '/vip/order/' + id,
    method: 'get'
  })
}

// 新增VIP订单
export function addVipOrder(data) {
  return request({
    url: '/vip/order',
    method: 'post',
    data: data
  })
}

// 修改VIP订单
export function updateVipOrder(data) {
  return request({
    url: '/vip/order',
    method: 'put',
    data: data
  })
}

// 删除VIP订单
export function delVipOrder(ids) {
  return request({
    url: '/vip/order/' + ids,
    method: 'delete'
  })
}

// 根据订单号查询VIP订单
export function getVipOrderByOrderSn(orderSn) {
  return request({
    url: '/vip/order/sn/' + orderSn,
    method: 'get'
  })
}

// 根据用户ID查询VIP订单列表
export function getVipOrderByUserId(userId) {
  return request({
    url: '/vip/order/user/' + userId,
    method: 'get'
  })
}

// 手动完成订单（管理员操作）
export function completeVipOrder(orderSn) {
  return request({
    url: '/vip/order/complete/' + orderSn,
    method: 'post'
  })
}

// 取消订单（管理员操作）
export function cancelVipOrder(orderSn) {
  return request({
    url: '/vip/order/cancel/' + orderSn,
    method: 'post'
  })
}

// 获取订单统计信息
export function getVipOrderStatistics() {
  return request({
    url: '/vip/order/statistics',
    method: 'get'
  })
}

// 导出VIP订单
export function exportVipOrder(query) {
  return request({
    url: '/vip/order/export',
    method: 'post',
    params: query
  })
}